package com.md.api.dao;

import com.md.api.entity.ShoppingOrder;
import com.md.api.entity.ShoppingOrderDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShoppingOrderMapper {
    int deleteByOrderNo(@Param("orderNo")String orderNo);

    int initOrder(ShoppingOrder record);

    int updateOrder(ShoppingOrder record);
    int updateStatus(ShoppingOrder record);

    List<ShoppingOrder> list(@Param("userId") String userId, @Param("orderStatus")  Integer orderStatus,
                             @Param("orderType")  Integer orderType, @Param("payType")  Integer payType,
                             @Param("payTimeStart")  String payTimeStart, @Param("payTimeEnd")  String payTimeEnd);

    List<ShoppingOrder> sysList(@Param("isShip")  Integer isShip, @Param("orderStatus")  Integer orderStatus,
                                @Param("orderType")  Integer orderType, @Param("payType")  Integer payType,
                                @Param("payTimeStart")  String payTimeStart, @Param("payTimeEnd")  String payTimeEnd);

    ShoppingOrder getByOrderNo(@Param("orderNo")String orderNo);

    List<ShoppingOrderDetail> orderDetail(@Param("orderNo")String orderNo);

    int setSign(@Param("orderNo")String orderNo, @Param("sign")String sign);

    int distributeOrder(@Param("orderNo")String orderNo, @Param("skuId")String skuId, @Param("shippingName")String shippingName,
                        @Param("shippingCode")String shippingCode, @Param("deliveryTime")String deliveryTime);
    int confirmOrder(@Param("orderNo")String orderNo, @Param("skuId")String skuId,@Param("isConfirm")Integer isConfirm);

    int getNotConfirmOrderCount(@Param("orderNo")String orderNo);

    int setShip(@Param("orderNo")String orderNo);

    List<ShoppingOrderDetail> getNotConfirmOrder();
}